package Limit.BuffDoll;

import l1j.server.server.ClientThread;
import l1j.server.server.clientpackets.ClientBasePacket;
import l1j.server.server.model.L1Object;
import l1j.server.server.model.L1World;
import l1j.server.server.model.Instance.L1DollInstance;
import l1j.server.server.model.Instance.L1NpcInstance;
import l1j.server.server.model.Instance.L1PcInstance;
import l1j.server.server.model.Instance.L1PetInstance;
import l1j.server.server.model.Instance.L1SummonInstance;
import l1j.server.server.serverpackets.S_NPCTalkReturn;
import l1j.server.server.serverpackets.S_SystemMessage;
import l1j.server.server.utils.Random;

public class E_BuffDoll extends ClientBasePacket
{
	private static final String E_BuffDoll = "[E] E_BuffDoll";
	
	public E_BuffDoll(byte abyte0[], ClientThread client) throws Exception 
	{
		super(abyte0);
		int objid = readD();
		String s = readS();
		
		L1PcInstance pc = client.getActiveChar();
		L1Object obj = L1World.getInstance().findObject(objid);
		if ((((L1NpcInstance) obj).getNpcTemplate().get_npcId() >= 902800) && (((L1NpcInstance) obj).getNpcTemplate().get_npcId() <= 902809)
				|| ((L1NpcInstance) obj).getNpcTemplate().get_npcId() == 901020)
		{
			String htmlid = "";
			String[] htmldata = null;		
		
			if (obj != null) 
			{
				if (obj instanceof L1NpcInstance) 
				{
					L1NpcInstance npc = (L1NpcInstance) obj;
					int difflocx = Math.abs(pc.getX() - npc.getX());
					int difflocy = Math.abs(pc.getY() - npc.getY());
					
					if (!(obj instanceof L1PetInstance)
						&& !(obj instanceof L1SummonInstance)) 
					{					
						if ((difflocx > 3) || (difflocy > 3)) 
						{ // 3格以上的距離對話無效
							return;
							}
					}
					npc.onFinalAction(pc, s);
				}
			}
			
			// buff娃娃設定
			if((((L1NpcInstance) obj).getNpcTemplate().get_npcId() >= 902800) && (((L1NpcInstance) obj).getNpcTemplate().get_npcId() <= 902809)){
				String status = "";
				int itemId = 0;
				int page = 0;
				// type 1=騎, 2=王, 3=黑妖, 4=法, 5=龍, 6=幻, 7=火妖, 8=風妖, 9=地妖, 10=水妖 (npc編號 - 902799 = 1-10)
				int type = ((L1NpcInstance) obj).getNpcTemplate().get_npcId() - 902799;
				
				for (L1DollInstance doll : pc.getDollList().values()) {
					itemId = doll.getItemObjId();
				}
				
				BuffDoll_Info_Load info = BuffDoll_Info_Table.getInstance().getTemplate(itemId);
				BuffDoll_Info_Table updateinfo = BuffDoll_Info_Table.getInstance();
				BuffDoll_DollSkill_Table updateSkill = BuffDoll_DollSkill_Table.getInstance();
				updateSkill.loadDollSkill_Info(itemId);
				BuffDoll_DollSkill_Load Skill = BuffDoll_DollSkill_Table.getInstance().getTemplate(itemId);	
				
				int lv = info.getLevel();
				
				//升級按摩
				if (s.equalsIgnoreCase("BuffD_LV")){
					if(pc.getInventory().checkItem(70212)){
						if (lv < 10){
							info.setLevel(10);
						} else {
							pc.sendPackets(new S_SystemMessage("等級已達上限。"));
						}
					} else {
						pc.sendPackets(new S_SystemMessage("娃娃乾糧不足。"));
					}
				}
				//娃娃 自動加狀態 啟動
				else if (s.equalsIgnoreCase("BuffD_S")) {
					((L1NpcInstance) obj).setHierarch(1);
				} 
				//娃娃 自動加狀態 關閉
				else if (s.equalsIgnoreCase("BuffD_E")) {
					((L1NpcInstance) obj).setHierarch(0);
				}
				//娃娃 自己回魔開關
				else if (s.equalsIgnoreCase("BuffD_Auto")) {
					if(pc.getInventory().checkItem(70213))
						info.setAuto_Res(true);
					else{
						pc.sendPackets(new S_SystemMessage("娃娃艾草不足。"));
						info.setAuto_Res(false);
					}
				}
				//學習技能轉頁
				else if (s.equalsIgnoreCase("BuffD_LS")){
					page = 1;
				}
				//清除 已選魔法娃娃
				else if (s.equalsIgnoreCase("BuffDDC_1")){
					if (info.getDoll1() != 0){
						if (pc.getInventory().checkItem(70217)){
							pc.getInventory().consumeItem(70217, 1);
							info.setDoll1(0);
						} else {
							pc.sendPackets(new S_SystemMessage("遺忘印不足。"));
						}
					} else {
						pc.sendPackets(new S_SystemMessage("沒有選擇娃娃。"));
					}
				}
				else if (s.equalsIgnoreCase("BuffDDC_2")){
					if (info.getDoll1() != 0){
						if (pc.getInventory().checkItem(70217)){
							if (info.getDoll2Pay()){
								pc.getInventory().consumeItem(70217, 1);
								info.setDoll2(0);
							} else {
								pc.sendPackets(new S_SystemMessage("需靈氣球解鎖。"));
							}
						} else {
							pc.sendPackets(new S_SystemMessage("遺忘印不足。"));
						}
					} else {
						pc.sendPackets(new S_SystemMessage("沒有選擇娃娃。"));
					}
				}
				else 
				{
					String[] whichs = s.split("_");
					int which = Integer.parseInt(whichs[1]);
					//個另技能開關
					if (s.equalsIgnoreCase("BuffDS_" + which)) {	
						if (!checkInfoPlace(which, info, pc, Skill, lv))
							pc.sendPackets(new S_SystemMessage("請先設定技能。"));
					} 
					//個另技能轉換 轉頁
					else if (s.equalsIgnoreCase("BuffDC_" + which)){					
						if (!ChangeSkill(which, info, pc, Skill, lv))
							page = 2;
					}
					//學習技能
					else if (s.equalsIgnoreCase("BuffDLS_" + which)){
						int buffid = BuffDoll_SkillList_Table.getInstance().loadSkillId(type, which);
						BuffDoll_SkillList_Load loadskill = BuffDoll_SkillList_Table.getInstance().getTemplateID(buffid);
						int bookid = loadskill.getLearn_Item();
						if (!Skill.checkBuff(buffid)){
							if (pc.getInventory().checkItem(bookid)){
								pc.getInventory().consumeItem(bookid, 1);
								updateSkill.StorageSkill(itemId, loadskill.getID(), loadskill.getIMG(), loadskill.getTime(), loadskill.getHtml_IMG(), loadskill.getName(), Skill);
							} else {
								pc.sendPackets(new S_SystemMessage("學習技能'"+loadskill.getName()+"'道具不足。"));
							}
						} else {
							pc.sendPackets(new S_SystemMessage("重覆學習技能也不會變的比較強大。"));
						}
					}
					//個另技能轉換
					else if (s.equalsIgnoreCase("BuffDCS_" + which)){
						ChoseSkill(which, info, pc, Skill);
					}
					//選擇娃娃 轉頁頁
					else if(s.equalsIgnoreCase("BuffDD_" + which)){
						if (loadPage_CD(which, info, pc)){
							page = 3;
						}
					}
					//選擇娃娃
					else if(s.equalsIgnoreCase("BuffDCD_" + which)){
						ChoseDoll(which, itemId, pc);
					}
				}
				updateSkill.UpdateDollSkill_Info(itemId, Skill);
				updateinfo.updateBuffDoll_info(itemId, info);
				updateinfo.delTemplate(itemId);
				updateinfo.loadBuffDoll_info(itemId);
				BuffDoll_Info_Load infonow = BuffDoll_Info_Table.getInstance().getTemplate(itemId);
				
				String heal = String.valueOf(pc.getHierarch() * 10);
				if (((L1NpcInstance) obj).getHierarch() == 1) {
					status = "啟動";
				} else {
					status = "暫停";
				}
				String getname = ((L1NpcInstance) obj).getName();
				String mp = String.valueOf(((L1NpcInstance) obj).getCurrentMp());
				String maxmp = String.valueOf(((L1NpcInstance) obj).getMaxMp());
				
				if(page == 1){
					htmldata = loadPage_LS(type,Skill);
					htmlid = "BuffD_LS";
				} else if (page == 2){
					htmldata = loadPage_CS(Skill);
					htmlid = "BuffD_CS";
				} else if ( page == 3 ){
					htmlid = "BuffD_CD";
				} else {
					htmldata = infonow.getInfo(getname, mp, maxmp, status, heal);
					htmlid = "BuffD_FP";
				}
				pc.sendPackets(new S_NPCTalkReturn(objid, htmlid, htmldata));
			} 
			
			else if (((L1NpcInstance) obj).getNpcTemplate().get_npcId() == 901020){
				if (s.equalsIgnoreCase("BuffD_ChangeClass")){
					if (pc.getInventory().checkItem(70218)){
						pc.getInventory().consumeItem(70218, 1);
						pc.sendPackets(new S_SystemMessage("Buff娃娃職業已被重置。"));
						pc.setDollClass(0);
					} else {
						pc.sendPackets(new S_SystemMessage("Buff娃娃重生証不足。"));
					}
				} else if (s.equalsIgnoreCase("BD_P")){
					if (pc.getDollClass() == 0){
						pc.setDollClass(2);
						pc.sendPackets(new S_SystemMessage("已選定Buff娃娃職業為王族。"));
					} else {
						pc.sendPackets(new S_SystemMessage("你已選擇了娃娃職業，如需更換請先重置娃娃職業。"));
					}
				} else if (s.equalsIgnoreCase("BD_K")){
					if (pc.getDollClass() == 0){

						pc.setDollClass(1);
						pc.sendPackets(new S_SystemMessage("已選定Buff娃娃職業為騎士。"));
					} else {
						pc.sendPackets(new S_SystemMessage("你已選擇了娃娃職業，如需更換請先重置娃娃職業。"));
					}
				} else if (s.equalsIgnoreCase("BD_DE")){
					if (pc.getDollClass() == 0){

						pc.setDollClass(3);
						pc.sendPackets(new S_SystemMessage("已選定Buff娃娃職業為黑妖。"));
					} else {
						pc.sendPackets(new S_SystemMessage("你已選擇了娃娃職業，如需更換請先重置娃娃職業。"));
					}
				} else if (s.equalsIgnoreCase("BD_M")){
					if (pc.getDollClass() == 0){

						pc.setDollClass(4);
						pc.sendPackets(new S_SystemMessage("已選定Buff娃娃職業為法師。"));
					} else {
						pc.sendPackets(new S_SystemMessage("你已選擇了娃娃職業，如需更換請先重置娃娃職業。"));
					}
				} else if (s.equalsIgnoreCase("BD_DK")){
					if (pc.getDollClass() == 0){

						pc.setDollClass(5);
						pc.sendPackets(new S_SystemMessage("已選定Buff娃娃職業為龍騎士。"));
					} else {
						pc.sendPackets(new S_SystemMessage("你已選擇了娃娃職業，如需更換請先重置娃娃職業。"));
					}
				} else if (s.equalsIgnoreCase("BD_I")){
					if (pc.getDollClass() == 0){

						pc.setDollClass(6);
						pc.sendPackets(new S_SystemMessage("已選定Buff娃娃職業為幻術師。"));
					} else {
						pc.sendPackets(new S_SystemMessage("你已選擇了娃娃職業，如需更換請先重置娃娃職業。"));
					}
				} else if (s.equalsIgnoreCase("BD_EF")){
					if (pc.getDollClass() == 0){

						pc.setDollClass(7);
						pc.sendPackets(new S_SystemMessage("已選定Buff娃娃職業為妖精(火)。"));
					} else {
						pc.sendPackets(new S_SystemMessage("你已選擇了娃娃職業，如需更換請先重置娃娃職業。"));
					}
				} else if (s.equalsIgnoreCase("BD_EW")){
					if (pc.getDollClass() == 0){

						pc.setDollClass(8);
						pc.sendPackets(new S_SystemMessage("已選定Buff娃娃職業為妖精(風)。"));
					} else {
						pc.sendPackets(new S_SystemMessage("你已選擇了娃娃職業，如需更換請先重置娃娃職業。"));
					}
				} else if (s.equalsIgnoreCase("BD_EE")){
					if (pc.getDollClass() == 0){

						pc.setDollClass(9);
						pc.sendPackets(new S_SystemMessage("已選定Buff娃娃職業為妖精(地)。"));
					} else {
						pc.sendPackets(new S_SystemMessage("你已選擇了娃娃職業，如需更換請先重置娃娃職業。"));
					}
				} else if (s.equalsIgnoreCase("BD_EWA")){
					if (pc.getDollClass() == 0){

						pc.setDollClass(10);
						pc.sendPackets(new S_SystemMessage("已選定Buff娃娃職業為妖精(水)。"));
					} else {
						pc.sendPackets(new S_SystemMessage("你已選擇了娃娃職業，如需更換請先重置娃娃職業。"));
					}
				}
			}
		}
	}
	
	private boolean checkInfoPlace(int i, BuffDoll_Info_Load info, L1PcInstance pc, BuffDoll_DollSkill_Load skill, int lv){
		boolean isTrue = false;
		switch (i)
		{
		case 1:
			if(info.getPlace1() != 0){				
				if(!info.getPlace1Use()){
					info.setPlace1Use(true);
					skill.setResident(true, i);
				} else {
					info.setPlace1Use(false);
					skill.setResident(false, i);
				}
				isTrue = true;
			}
			break;
		case 2:
			if(lv >= 3){
				if(info.getPlace2() != 0){				
					if(!info.getPlace2Use()){
						info.setPlace2Use(true);
						skill.setResident(true, i);
					} else {
						info.setPlace2Use(false);
						skill.setResident(false, i);
					}
					isTrue = true;
				}
			} else {
				pc.sendPackets(new S_SystemMessage("娃娃等級不足。"));
				isTrue = true;
			}
			break;
		case 3:
			if(lv >= 6){
				if(info.getPlace3() != 0){				
					if(!info.getPlace3Use()){
						info.setPlace3Use(true);
						skill.setResident(true, i);
					} else {
						info.setPlace3Use(false);
						skill.setResident(false, i);
					}
					isTrue = true;
				}
			} else {
				pc.sendPackets(new S_SystemMessage("娃娃等級不足。"));
				isTrue = true;
			}
			break;
		case 4:
			if (lv >= 10){
				if(info.getPlace4() != 0){				
					if(!info.getPlace4Use()){
						info.setPlace4Use(true);
						skill.setResident(true, i);
					} else {
						info.setPlace4Use(false);
						skill.setResident(false, i);
					}
					isTrue = true;
				}
			} else {
				pc.sendPackets(new S_SystemMessage("娃娃等級不足。"));
				isTrue = true;
			}
			break;
		case 5:
			if(info.getPlace5Pay()){
				if(info.getPlace5() != 0){
					if(!info.getPlace5Use()){
						info.setPlace5Use(true);
						skill.setResident(true, i);
					} else {
						info.setPlace5Use(false);
						skill.setResident(false, i);
					}
					isTrue = true;
				}
			} else {
				if (pc.getInventory().checkItem(70215)){
					pc.getInventory().consumeItem(70215, 1);
					info.setPlace5Pay(true);
					isTrue = true;
				} else {
					pc.sendPackets(new S_SystemMessage("需娃娃的靈息解鎖。"));
					isTrue = true;
				}
			}
			break;
		case 6:
			if(info.getPlace6Pay()){
				if(info.getPlace6() != 0){
					if(!info.getPlace6Use()){
						info.setPlace6Use(true);
						skill.setResident(true, i);
					} else {
						info.setPlace6Use(false);
						skill.setResident(false, i);
					}
					isTrue = true;
				}
			} else {
				if (pc.getInventory().checkItem(70215)){
					pc.getInventory().consumeItem(70215, 1);
					info.setPlace6Pay(true);
					isTrue = true;
				} else {
					pc.sendPackets(new S_SystemMessage("需娃娃的靈息解鎖。"));
					isTrue = true;
				}
			}
			break;
		}
		return isTrue;
	}
	
	private boolean ChangeSkill(int i, BuffDoll_Info_Load info, L1PcInstance pc, BuffDoll_DollSkill_Load skill,int lv){
		boolean isTrue = false;
		switch (i)
		{
		case 1:
			if (info.getPlace1() != 0) {						
				if(pc.getInventory().checkItem(70214)){
					pc.getInventory().consumeItem(70214, 1);
					info.setPlace1(0);
					info.setPlace1Use(false);
					info.setChangePlace(i);
					skill.setResident(false, i);
					skill.cleanPlace(i);
				} else {
					pc.sendPackets(new S_SystemMessage("遗忘玉不足。"));
					isTrue = true;
				}
			} else {
				info.setChangePlace(i);
				info.setPlace1Use(false);
				info.setChangePlace(i);
				skill.setResident(false, i);
				skill.cleanPlace(i);
			}
			break;
		case 2:
			if (lv >= 3){
				if (info.getPlace2() != 0) {						
					if(pc.getInventory().checkItem(70214)){
						pc.getInventory().consumeItem(70214, 1);
						info.setPlace2(0);
						info.setPlace2Use(false);
						info.setChangePlace(i);
						skill.setResident(false, i);
						skill.cleanPlace(i);
					} else {
						pc.sendPackets(new S_SystemMessage("遗忘玉不足。"));
						isTrue = true;
					}
				} else {
					info.setPlace2(0);
					info.setPlace2Use(false);
					info.setChangePlace(i);
					skill.setResident(false, i);
				}
			} else {
				pc.sendPackets(new S_SystemMessage("娃娃等級不足。"));
				isTrue = true;
			}
			break;
		case 3:
			if (lv >= 6){
				if (info.getPlace3() != 0) {						
					if(pc.getInventory().checkItem(70214)){
						pc.getInventory().consumeItem(70214, 1);
						info.setPlace3(0);
						info.setPlace3Use(false);
						info.setChangePlace(i);
						skill.setResident(false, i);
						skill.cleanPlace(i);
					} else {
						pc.sendPackets(new S_SystemMessage("遗忘玉不足。"));
						isTrue = true;
					}
				} else {
					info.setPlace3(0);
					info.setPlace3Use(false);
					info.setChangePlace(i);
					skill.setResident(false, i);
				}
			} else {
				pc.sendPackets(new S_SystemMessage("娃娃等級不足。"));
				isTrue = true;
			}
			break;
		case 4:
			if (lv >= 10){
				if (info.getPlace4() != 0) {						
					if(pc.getInventory().checkItem(70214)){
						pc.getInventory().consumeItem(70214, 1);
						info.setPlace4(0);
						info.setPlace4Use(false);
						info.setChangePlace(i);
						skill.setResident(false, i);
						skill.cleanPlace(i);
					} else {
						pc.sendPackets(new S_SystemMessage("遗忘玉不足。"));
						isTrue = true;
					}
				} else {
					info.setPlace4(0);
					info.setPlace4Use(false);
					info.setChangePlace(i);
					skill.setResident(false, i);
				}
			} else {
				pc.sendPackets(new S_SystemMessage("娃娃等級不足。"));
				isTrue = true;
			}
			break;
		case 5:
			if (info.getPlace5Pay()){
				if (info.getPlace5() != 0) {						
					if(pc.getInventory().checkItem(70214)){
						pc.getInventory().consumeItem(70214, 1);
						info.setPlace5(0);
						info.setPlace5Use(false);
						info.setChangePlace(i);
						skill.setResident(false, i);
						skill.cleanPlace(i);
					} else {
						pc.sendPackets(new S_SystemMessage("遗忘玉不足。"));
						isTrue = true;
					}
				} else {
					info.setPlace5(0);
					info.setPlace5Use(false);
					info.setChangePlace(i);
					skill.setResident(false, i);
				}
			} else {
				pc.sendPackets(new S_SystemMessage("需道具解鎖。"));
				isTrue = true;
			}
			break;
		case 6:
			if (info.getPlace6Pay()){
				if (info.getPlace6() != 0) {						
					if(pc.getInventory().checkItem(70214)){
						pc.getInventory().consumeItem(70214, 1);
						info.setPlace6(0);
						info.setPlace6Use(false);
						info.setChangePlace(i);
						skill.setResident(false, i);
						skill.cleanPlace(i);
					} else {
						pc.sendPackets(new S_SystemMessage("遗忘玉不足。"));
						isTrue = true;
					}
				} else {
					info.setPlace6(0);
					info.setPlace6Use(false);
					info.setChangePlace(i);
					skill.setResident(false, i);
				}
			} else {
				pc.sendPackets(new S_SystemMessage("需道具解鎖。"));
				isTrue = true;
			}
			break;
		}
		return isTrue;
	}
	private void ChoseSkill(int i, BuffDoll_Info_Load info, L1PcInstance pc, BuffDoll_DollSkill_Load skill){
		int buffid = skill.getSkillInfo()[i-1][0];
		int htmlimg = skill.getSkillInfo()[i-1][3];
		int changeplace = info.getChangePlace();
		if (!skill.checkBuffWithPlace(buffid)){
			skill.setPlace(changeplace, buffid);
			switch(changeplace)
			{
			case 1:
				info.setPlace1(htmlimg);
				break;
			case 2:
				info.setPlace2(htmlimg);
				break;
			case 3:
				info.setPlace3(htmlimg);
				break;
			case 4:
				info.setPlace4(htmlimg);
				break;
			case 5:
				info.setPlace5(htmlimg);
				break;
			case 6:
				info.setPlace6(htmlimg);
				break;
			}
		} else {
			pc.sendPackets(new S_SystemMessage("不能選擇重覆技能。"));
		}
	}
	
	private void ChoseDoll(int which, int itemId, L1PcInstance pc){
		int rnd = Random.nextInt(100);
		int change = 80;
		BuffDoll_Info_Load info = BuffDoll_Info_Table.getInstance().getTemplate(itemId);
		int dollid = which + 59999;
		if (which == 22)
			dollid = 70042;
		if (dollid == 60018 || dollid == 60019 || dollid == 60020 || dollid == 70042 || dollid == 60014 || dollid == 60015)
			change = 60;
		if (pc.getInventory().checkItem(dollid)){
			pc.getInventory().consumeItem(dollid, 1);
			
			if ( info.getChangeDoll() == 1 ){
				if (rnd < change){
					info.setDoll1(dollid);
				} else {
					pc.sendPackets(new S_SystemMessage("魔法娃娃合拼失敗，魔法娃娃消失了。"));
				}
			} else if ( info.getChangeDoll() == 2 ) {
				if (rnd < change - 20){
					info.setDoll2(dollid);
				} else {
					pc.sendPackets(new S_SystemMessage("魔法娃娃合拼失敗，魔法娃娃消失了。"));
				}
			}
		} else {
			pc.sendPackets(new S_SystemMessage("所選擇合拼的娃娃不足。"));
		}
	}
	
	private boolean loadPage_CD(int which, BuffDoll_Info_Load info, L1PcInstance pc){
		if (which == 1){
			if (info.getDoll1() == 0){
				info.setChangeDoll(which);
				return true;
			} else {
				pc.sendPackets(new S_SystemMessage("如需要更換合拼娃娃，請點擊　更換　按鈕"));
			}
		} else if ( which == 2){
			if (info.getDoll2Pay()){
				if (info.getDoll2() == 0){
					info.setChangeDoll(which);
					return true;
				} else {
					pc.sendPackets(new S_SystemMessage("如需要更換合拼娃娃，請點擊　更換　按鈕"));
				}
			} else {
				if (pc.getInventory().checkItem(70216)){
					pc.getInventory().consumeItem(70216, 1);
					info.setDoll2Pay(true);
				} else {
					pc.sendPackets(new S_SystemMessage("需要靈氣球解鎖。"));
				}
			}
		}
		return false;
	}
	
	private String[] loadPage_CS(BuffDoll_DollSkill_Load skill){
		int[][] skillimg = skill.getSkillInfo();
		String[] list = new String[60];
		int i;
		for(i = 0; i < 60; i++){
			list[i] = "3339";
		}
		for(i = 0; i < skillimg.length; i++){
			list[i] = ""+skillimg[i][3];
			if(skillimg[i][4] > 0){
				list[i+20] = "1023";
				list[i+40] = "1024";
			} else {
				list[i+20] = "1025";
				list[i+40] = "1026";
			}
		}
		return list;
	}
	
	private String[] loadPage_LS(int type,  BuffDoll_DollSkill_Load skill){
		int[] skillimg = BuffDoll_SkillList_Table.getInstance().listsType(type);
		int[][] skillinfo = skill.getSkillInfo();
		String[] list = new String[60];
		int i;
		for(i = 0; i < 60; i++){
			list[i] = "3339";
		}
		for(i = 0; i < skillimg.length; i++){
			list[i] = ""+skillimg[i];
			list[i+20] = "1025";
			list[i+40] = "1026";
			for(int j = 0; j < skillinfo.length; j++){
				if(skillimg[i] == skillinfo[j][3]){
					list[i+20] = "1023";
					list[i+40] = "1024";
				}
			}
		}
		return list;
	}
	
	public String getType() 
	{
		return E_BuffDoll;
	}
}
